import java.util.ArrayList;
import java.util.List;
//添加功能：预算管理、月度统计”
class Bill {
    private String description;
    private double amount;

    public Bill(String description, double amount) {
        this.description = description;
        this.amount = amount;
    }

    public String getDescription() {
        return description;
    }

    public double getAmount() {
        return amount;
    }
}

class Budget {
    private List<Bill> bills = new ArrayList<>();

    // 记录收入
    public void recordIncome(String description, double amount) {
        bills.add(new Bill("收入: " + description, amount));
    }

    // 记录支出
    public void recordExpense(String description, double amount) {
        bills.add(new Bill("支出: " + description, amount));
    }

    // 显示所有账单
    public void showBills() {
        for (Bill bill : bills) {
            System.out.println(bill.getDescription() + ": " + bill.getAmount());
        }
    }

    // 查询特定账单
    public Bill queryBill(String description) {
        for (Bill bill : bills) {
            if (bill.getDescription().contains(description)) {
                return bill;
            }
        }
        return null; // 如果找不到账单，返回null
    }
}

class Main {
    public static void main(String[] args) {
        Budget budget = new Budget();

        // 示例：记录收入和支出
        budget.recordIncome("工资", 5000);
        budget.recordExpense("水电费", 200);

        // 显示所有账单
        budget.showBills();

        // 查询特定账单
        Bill queriedBill = budget.queryBill("工资");
        if (queriedBill != null) {
            System.out.println("查询到的账单: " + queriedBill.getDescription() + ": " + queriedBill.getAmount());
        } else {
            System.out.println("未找到对应的账单。");
        }
    }
}
